package com.ch01.ex26;


/**
 * Created by zc on 2016/1/27.
 */
public class Main {

    public static void main(String[] args){
        EventStorage storage = new EventStorage();

        Producer producer = new Producer(storage);
        Thread thread1 =new Thread(producer);

        Consumer consumer = new Consumer(storage);
        Thread thread2 = new Thread(consumer);

        thread1.start();
        thread2.start();

        try {
            thread1.join();
            thread2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
